<?php
header("Content-type: text/html; charset=utf-8");

$rq_qq=$_REQUEST['qq'];
$rq_politics=$_REQUEST['politics'];
$rq_english=$_REQUEST['english'];
$rq_math=$_REQUEST['math'];
$rq_major=$_REQUEST['major'];
$rq_total=$_REQUEST['total'];




//连接数据库
$conn = mysql_connect("10.4.12.173:3306", "ugZ27ryCUMywR", 'pPUZZaXlve6GK');
if (!$conn)
{
	echo "<script>alert('数据库连接失败')</script>";
	die();
}
mysql_select_db("dc772e1acdec14be7a389e8ccf9077224", $conn);
try{
$sql_str = 'INSERT INTO result(qq, politics, english, math, major, total) VALUES("'.$rq_qq.'","'.$rq_politics.'","'.$rq_english.'","'.$rq_math.'","'.$rq_major.'","'.$rq_total.'")';
mysql_query("set names utf8");
mysql_query( $sql_str);
echo "提交成功！";
//header('Location: result.html');
} catch (Exception $e) {
	echo "提交失败，请检查后重新提交";
	exit();
}
mysql_close();
?>